package org.ellwood.core.common.valid.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.ellwood.core.common.valid.validator.NotZeroValidator;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @ProjectName: ellwood-boot-pro
 * @PackageName: org.ellwood.core.common.valid.annotation
 * @ClassName: NotZero
 * @Description: // 非零
 * @Author: Ellwood
 * @CreateDate: 2024/6/18 - 下午12:00
 * @Version: V1.0.0
 */
@Target({ElementType.FIELD,ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = NotZeroValidator.class)
public @interface NotZero {

    String message() default "Value must be non-null and non-zero";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
